/*******************************************************************************
 * Copyright 2011 See AUTHORS file.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/

package com.asg.guesswhat;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Application.ApplicationType;


public class Settings {
	//public final static String settingsPath = "";
	//public final static String settingsPath = "C:\\Users\\Blakbro2k\\workspace\\GuessWhat\\guesswhat-desktop\\";
	//public final static String file = ".guesswhat";
	//public final static Config settings = new Config(settingsPath + file);
	
	public static boolean soundEnabled = false;
	public static String username = "blakbro2k";
	public static String email = "blakbro2k@asg.com";
	public static String mobilNumber = "5552345463";
	public static int hostID = 1;
	public static String defaultCardSet = "standard.cset";
 
 
	public static String[] cardSetObj = {"standard",
			"Philip;0;0;88;102;blond",
			"Sam;0;0;88;102;black",
			"Frans;0;0;88;102;",
			"Max;0;0;88;102;",
			"Robert;0;0;88;102;",
			"Alex;0;0;88;102;",
			"Paul;0;0;88;102;",
			"Richard;0;0;88;102;",
			"Anne;0;0;88;102;",
			"David;0;0;88;102;",
			"Peter;0;0;88;102;",
			"Charles;0;0;88;102;",
			"Eric;0;0;88;102;",
			"George;0;0;88;102;",
			"Bill;0;0;88;102;",
			"Susan;0;0;88;102;",
			"Alfred;0;0;88;102;",
			"Bernard;0;0;88;102;",
			"Herman;0;0;88;102;",
			"Anita;0;0;88;102;",
			"Maria;0;0;88;102;",
			"Tom;0;0;88;102;",
			"Joe;0;0;88;102;",
			"Claire;0;0;88;102;",
			"data/standard.png",
			"0;0;88;102"};

	public static void load(/*boolean inSet*/) {
 
		ApplicationType appType = Gdx.app.getType();
		
		// should work also with Gdx.input.isPeripheralAvailable(Peripheral.Accelerometer)
		if (appType == ApplicationType.Android || appType == ApplicationType.iOS) {
			System.out.println("isAndroid");
		} else {
			System.out.println("isDesktop");
		}
		
		/*username = settings.getProperty("username");
		if(username.isEmpty()){
			username = "gwplayer21312";
			save("username",username);
		} else {
			username = settings.getProperty("username");
		}
		email = settings.getProperty("email");
		if(email.isEmpty()){
			email = username + "@gw.com";
			save("email",email);
		} else {
			email = settings.getProperty("email");
		}
		//hostID = Integer.parseInt(settings.getProperty("hostID"));
		if(hostID < 1){
			hostID = 312;
			save("hostID",hostID);
		} else {
			hostID = Integer.parseInt(settings.getProperty("hostID"));
		}
		defaultCardSet = settings.getProperty("defaultCardSet");
		if(defaultCardSet.isEmpty()){
			defaultCardSet = "standard.cset";
			save("defaultCardSet",defaultCardSet);
		} else {
			defaultCardSet = settings.getProperty("defaultCardSet");
		}
		soundEnabled = Boolean.parseBoolean(settings.getProperty("soundEnabled"));
		save("soundEnabled","" + soundEnabled);
		//System.out.println(settings.getProperty("soundEnabled"));
		//save("mobilNumber",mobilNumber);*/
	}

	public static void save(String key, String value) {
		//System.out.println("Saving: " + key + ":" + value);
		//settings.setProperty(key,value,file);
	}
	
	public static void save(String key, int value) {
		//System.out.println("Saving: " + key + ":" + value);
		//settings.setProperty(key,"" + value,file);
	}

	public static void toggleSound () {
		soundEnabled = !soundEnabled;
	}
}
